const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
var FROZEN_WINDOW_BRIGHTNESS = -0.3
var DIALOG_TRANSITION_TIME = 0.15
+var ALIVE_TIMEOUT = 5000;
var CloseDialog = new Lang.Class({
Name: 'CloseDialog',
this.parent();
this._window = window;
this._dialog = null;
+ this._timeoutId = 0;
},
get window() {
Meta.disable_unredirect_for_screen(global.screen);
+ this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, ALIVE_TIMEOUT,
+ () => {
+ this._window.check_alive(global.display.get_current_time_roundtrip());
+ return GLib.SOURCE_CONTINUE;
+ });
+
this._addWindowEffect();
this._initDialog();
Meta.enable_unredirect_for_screen(global.screen);
+ GLib.source_remove(this._timeoutId);
+ this._timeoutId = 0;
+
let dialog = this._dialog;
this._dialog = null;
this._removeWindowEffect();